import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class Test {
    public static void main1(String[] args) {
   /*     Stack<Integer> stack=new Stack<>();
        //入栈
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        //出栈，拿走
        Integer x=stack.pop();
        System.out.println(x);

        Integer y=stack.peek();
        System.out.println(y);
        //只看不拿走
        Integer y1=stack.peek();
        System.out.println(y1);*/
        MyStack myStack=new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);

     Integer x=   myStack.pop();
        System.out.println(x);
        }

    public static void main2(String[] args) {
        Queue<Integer>queue=new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        System.out.println(queue.poll());
        System.out.println(queue.peek());
        System.out.println(queue.offer(1));
    }

    public static void main(String[] args) {
        Deque<Integer> queue=new LinkedList<>();

    }

}
